function theadFixed(obj){
	$(window).bind('scroll', function() {
		if ($(window).scrollTop() > obj.offset().top) {
			if (obj.hasClass('thead-fixed')) {
				return;
			};
			var width = obj.outerWidth(true);
			var left = obj.offset().left;
			var ths = obj.find('th');
			for (var i = 0, len = ths.length; i < len; i++) {
				var tdWidth = $(ths[i]).outerWidth(true);
				$(ths[i]).width(tdWidth);
			}
			// $('.thead-fixed').removeClass('thead-fixed');
			obj.find('thead').css({
				'width': width,
				'left': left
			}).addClass('thead-fixed');
		} else {
			obj.find('thead').removeClass('thead-fixed');
		}
	});	
}
